1 <?php
2 session_start();
3 error_reporting(0);
4 include('includes/config.php');
5 if(isset($_POST['submit2']))
6 {
7 $pid=intval($_GET['pkgid']);
8 $useremail=$_SESSION['login'];
9 $fromdate=$_POST['fromdate'];
10 $todate=$_POST['todate'];
11 $comment=$_POST['comment'];
12 $status=0;
13 $sql="INSERT INTO tblbooking(PackageId,UserEmail,FromDate,ToDate,Comment,status) VALUES(:pid,:useremail,:fromdate,:todate,:comment,:status)";
14 $query = $dbh->prepare($sql);
15 $query->bindParam(':pid',$pid,PDO::PARAM_STR);
16 $query->bindParam(':useremail',$useremail,PDO::PARAM_STR);
17 $query->bindParam(':fromdate',$fromdate,PDO::PARAM_STR);
18 $query->bindParam(':todate',$todate,PDO::PARAM_STR);
19 $query->bindParam(':comment',$comment,PDO::PARAM_STR);
20 $query->bindParam(':status',$status,PDO::PARAM_STR);
21 $query->execute();
22 $lastInsertId = $dbh->lastInsertId();
23 if($lastInsertId)
24 {
25 $msg="Booked Successfully";
26 }
27 else
28 {
29 $error="Something went wrong. Please try again";
30 }
31
32 }
33 ?>
34 <!DOCTYPE HTML>
35 <html>
36 <head>
37 <title>TMS | Package Details</title>
38 <meta name="viewport" content="width=device-width, initial-scale=1">
39 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
40 <script type="applijewelleryion/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
41 <link href="css/bootstrap.css" rel='stylesheet' type='text/css' />
42 <link href="css/style.css" rel='stylesheet' type='text/css' />
43 <link href='//fonts.googleapis.com/css?family=Open+Sans:400,700,600' rel='stylesheet' type='text/css'>
44 <link href='//fonts.googleapis.com/css?family=Roboto+Condensed:400,700,300' rel='stylesheet' type='text/css'>
45 <link href='//fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>
46 <link href="css/font-awesome.css" rel="stylesheet">
47 <!-- Custom Theme files -->
48 <script src="js/jquery-1.12.0.min.js"></script>
49 <script src="js/bootstrap.min.js"></script>
50 <!--animate-->
51 <link href="css/animate.css" rel="stylesheet" type="text/css" media="all">
52 <script src="js/wow.min.js"></script>
53 <link rel="stylesheet" href="css/jquery-ui.css" />
54 <script>
55 new WOW().init();
56 </script>
57 <script src="js/jquery-ui.js"></script>
58 <script>
59 $(function() {
60 $( "#datepicker,#datepicker1" ).datepicker();
61 });
62 </script>
63 <style>
64 .errorWrap {
65 padding: 10px;
66 margin: 0 0 20px 0;
67 background: #fff;
68 border-left: 4px solid #dd3d36;
69 -webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
70 box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
71 }
72 .succWrap{
73 padding: 10px;
74 margin: 0 0 20px 0;
75 background: #fff;
76 border-left: 4px solid #5cb85c;
77 -webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
78 box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
79 }
80 </style>
81 </head>
82 <body>
83 <!-- top-header -->
84 <?php include('includes/header.php');?>
85 <div class="banner-3">
86 <div class="container">
87 <h1 class="wow zoomIn animated animated" data-wow-delay=".5s" style="visibility: visible; animation-delay: 0.5s; animation-name: zoomIn;"> TMS -Package Details</h1>
88 </div>
89 </div>
90 <!--- /banner ---->
91 <!--- selectroom ---->
92 <div class="selectroom">
93 <div class="container">
94 <?php if($error){?><div class="errorWrap"><strong>ERROR</strong>:<?php echo htmlentities($error); ?> </div><?php }
95 else if($msg){?><div class="succWrap"><strong>SUCCESS</strong>:<?php echo htmlentities($msg); ?> </div><?php }?>
96 <?php
97 $pid=intval($_GET['pkgid']);
98 $sql = "SELECT * from tbltourpackages where PackageId=:pid";
99 $query = $dbh->prepare($sql);
100 $query -> bindParam(':pid', $pid, PDO::PARAM_STR);
101 $query->execute();
102 $results=$query->fetchAll(PDO::FETCH_OBJ);
103 $cnt=1;
104 if($query->rowCount() > 0)
105 {
106 foreach($results as $result)
107 { ?>
108
109 <form name="book" method="post">
110 <div class="selectroom_top">
111 <div class="col-md-4 selectroom_left wow fadeInLeft animated" data-wow-delay=".5s">
112 <img src="admin/pacakgeimages/<?php echo htmlentities($result->PackageImage);?>" class="img-responsive" alt="">
113 </div>
114 <div class="col-md-8 selectroom_right wow fadeInRight animated" data-wow-delay=".5s">
115 <h2><?php echo htmlentities($result->PackageName);?></h2>
116 <p class="dow">#PKG-<?php echo htmlentities($result->PackageId);?></p>
117 <p><b>Package Type :</b> <?php echo htmlentities($result->PackageType);?></p>
118 <p><b>Package Location :</b> <?php echo htmlentities($result->PackageLocation);?></p>
119 <p><b>Features</b> <?php echo htmlentities($result->PackageFetures);?></p>
120 <div class="ban-bottom">
121 <div class="bnr-right">
122 <label class="inputLabel">From</label>
123 <input class="date" id="datepicker" type="text" placeholder="dd-mm-yyyy" name="fromdate" required="">
124 </div>
125 <div class="bnr-right">
126 <label class="inputLabel">To</label>
127 <input class="date" id="datepicker1" type="text" placeholder="dd-mm-yyyy" name="todate" required="">
128 </div>
129 </div>
130 <div class="clearfix"></div>
131 <div class="grand">
132 <p>Grand Total</p>
133 <h3>USD.800</h3>
134 </div>
135 </div>
136 <h3>Package Details</h3>
137 <p style="padding-top: 1%"><?php echo htmlentities($result->PackageDetails);?> </p>
138 <div class="clearfix"></div>
139 </div>
140 <div class="selectroom_top">
141 <h2>Travels</h2>
142 <div class="selectroom-info animated wow fadeInUp animated" data-wow-duration="1200ms" data-wow-delay="500ms" style="visibility: visible; animation-duration: 1200ms; animation-delay: 500ms; animation-name: fadeInUp; margin-top: -70px">
143 <ul>
144
145 <li class="spe">
146 <label class="inputLabel">Comment</label>
147 <input class="special" type="text" name="comment" required="">
148 </li>
149 <?php if($_SESSION['login'])
150 {?>
151 <li class="spe" align="center">
152 <button type="submit" name="submit2" class="btn-primary btn">Book</button>
153 </li>
154 <?php } else {?>
155 <li class="sigi" align="center" style="margin-top: 1%">
156 <a href="#" data-toggle="modal" data-target="#myModal4" class="btn-primary btn" > Book</a></li>
157 <?php } ?>
158 <div class="clearfix"></div>
159 </ul>
160 </div>
161
162 </div>
163 </form>
164 <?php }} ?>
165
166
167 </div>
168 </div>
169 <!--- /selectroom ---->
170 <<!--- /footer-top ---->
171 <?php include('includes/footer.php');?>
172 <!-- signup -->
173 <?php include('includes/signup.php');?>
174 <!-- //signu -->
175 <!-- signin -->
176 <?php include('includes/signin.php');?>
177 <!-- //signin -->
178 <!-- write us -->
179 <?php include('includes/write-us.php');?>
180 </body>
181 </html>